﻿
@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/MyMasterPage.cshtml";
}

    <div id="message">
        <!-- banner-area -->
        <div id="loadingDiv" style=" display:none">
            <div id="over" style=" position: absolute;top: 0;left: 0; width: 100%;height: 100%; background-color: #000;opacity:0.7;z-index: 1000;"></div>
            <div id="layout" style="position: absolute;top: 20%; left: 40%;width: 20%; height: 20%;  z-index: 1001;text-align:center;">
                <h1><i class="fa fa-check text-white"></i></h1><br />
                                              <h2 style="color: #fff;">提交成功，感谢你的意见建议！</h2>
            </div>
        </div>
        <section class="dark-section section-block">
            <div class="container">
                <div class="section-space"></div>
                <div class="row">
                    <div class="col-sm-6 offset-sm-1">
                        <div class="features-entry wow fadeInCdb">
                            <div class="image-holder">
                                <h2 class="section-title">意见建议</h2>
                                <p><strong>请提出你宝贵的意见或建议，让我们一起把更好的产品和服务提供给大家</strong></p>



                                <div class="row">
                                    <div class="form-group col-sm-6">
                                        <label class="control-label">姓名</label>
                                        <input size="4" type="text" v-model="formMess.MsName">
                                    </div>

                                    <div class="form-group col-sm-6">
                                        <label class="control-label">电话</label>
                                        <input autocomplete="off" type="text" v-model="formMess.MsHone">
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="form-group col-sm-12">
                                        <label class="control-label">标题</label>
                                        <input autocomplete="off" size="20" type="text" v-model="formMess.MsType">
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="form-group col-sm-12">
                                        <textarea name="mesajınız" rows="6" v-model="formMess.MsContent" class="margin-top-10" placeholder="请输入内容..."></textarea>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="form-group col-sm-12">
                                        <label>请确保你的信息真实有效，已便我们更好的服务！</label>

                                    </div>
                                </div>

                                <div class="row margin-top-30">
                                    <div class="col-sm-12">
                                        <button class="button" @@click="onSubmit()">提交</button>
                                    </div>
                                </div>


                            </div>
                        </div>
                    </div>
                    <div class="col-sm-3 offset-sm-1">
                        <div class="features-entry wow fadeInCdb">
                            <div class="image-holder">
                                <img width="800" height="500" src="assets/img/about/t4.jpg" alt="">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="mid-space"></div>
            </div>
        </section>
    </div>

    <script type="text/javascript">
            var vm = new Vue({
                el: "#message",
                data: {
                    formMess: {
                        MsName: "",
                        MsHone: "",
                        MsType: "",
                        MsContent: "",
                        MsAdddatetime: new Date("yyyy-MM-dd"),
                    }
                },
                mounted() {
                    this.getTime();
                },
                methods: {
                    //获取列表SaveFormJson
                    getTime() {
                        var _this = this;
                        let yy = new Date().getFullYear();
                        let mm = new Date().getMonth() + 1;
                        let dd = new Date().getDate();
                        let hh = new Date().getHours();
                        let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes();
                        let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds();
                        _this.formMess.MsAdddatetime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf ;
                    },
                    onSubmit() {
                       // console.log(this.formMess.MsAdddatetime)
                        //document.getElementById("loadingDiv").style.display = "block";//loading取消
                       
                        var that = this
                        $.ajax({
                            type: 'POST',
                            url: '/api/Message/SaveFormJson',
                            headers: {
                                "Content-Type": "application/x-www-form-urlencoded"
                            },
                            data: this.formMess,
                            success: function (res) {
                                alert("提交成功！感谢你的支持！")
                                window.location.reload();
                                //setTimeout(function () {
                                //    document.getElementById("loadingDiv").style.display = "none";//loading取消
                                //    window.location.reload();
                                //}, 500)
                              
                            }
                        });

                    }
                }
            })
    </script>
